//
//  WWHomeScanCompleteView.m
//  NTBuildOC
//
//  Created by yuhongdong on 2020/9/13.
//  Copyright © 2020 WeChat. All rights reserved.
//

#import "WWHomeScanCompleteView.h"

@interface WWHomeScanCompleteView ()

@property (nonatomic, strong) UILabel *completeLabel;
@property (nonatomic, strong) UILabel *tipsLabel;

@end


@implementation WWHomeScanCompleteView

#pragma mark - ♻️life cycle
-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupUI];
    }
    return self;
}

#pragma mark - 🔄overwrite

#pragma mark - 🚪public
-(void)setDeviceNumber:(NSString *)number {
    NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"发现%@台可疑设备\n被偷风险较高 点击查看可疑设备详情",number]];
    UIFont *font = [UIFont systemFontOfSize:35];
    [attrString addAttribute:NSFontAttributeName value:font range:NSMakeRange(2,number.length)];
    self.tipsLabel.attributedText = attrString;
}

#pragma mark - 🍐delegate

#pragma mark - ☎️notification

#pragma mark - 🎬event response

#pragma mark - 🔒private

#pragma mark - 🌲setupUI
-(void)setupUI {
    self.backgroundColor = [UIColor clearColor];
    
    [self addSubview:self.completeLabel];
    [self addSubview:self.tipsLabel];
    
    [self.completeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self);
    }];
    
    [self.tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.completeLabel.mas_bottom).offset(20);
        make.centerX.equalTo(self);
    }];

}

#pragma mark - 🖼getter and setter
-(UILabel *)completeLabel {
    if (_completeLabel == nil) {
        _completeLabel = [[UILabel alloc]init];
        _completeLabel.textColor = [UIColor colorWithHexString:@"#85FFA5"];
        _completeLabel.text = @"检测已完成";
        _completeLabel.font = [UIFont systemFontOfSize:15];
        _completeLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _completeLabel;
}

-(UILabel *)tipsLabel{
    if (_tipsLabel == nil) {
        _tipsLabel = [[UILabel alloc]init];
        _tipsLabel.textColor = [UIColor whiteColor];
        _tipsLabel.font = [UIFont systemFontOfSize:15];
        _tipsLabel.textAlignment = NSTextAlignmentCenter;
        _tipsLabel.numberOfLines = 0;
    }
    return _tipsLabel;
}

@end
